package com.iss.demo.service;

import com.iss.demo.dao.xtCourseDao;
import com.iss.demo.entity.xtCourse;
import com.iss.demo.model.xtCourseModel;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.ArrayList;
import java.util.List;

@Service
public class xtCourseService {
    @Autowired
    private xtCourseDao dao;

    public List<xtCourseModel> selectAll(){
        List<xtCourseModel> list = new ArrayList<>();
        list = dao.selectAll();
        return list;
    }

    public Integer delete(Integer xt_ids[]){
        return dao.delete(xt_ids);
    }

    public xtCourse selectById(Integer id){return dao.selectByid(id);}
    public Integer insertCourse(xtCourse xtcourse){
        return dao.insertCourse(xtcourse);
    }
    public Integer updateCourse(xtCourse xtcourse){
        return dao.updateCourse(xtcourse);
    }

    public xtCourseModel selectInfoById(Integer id){
        return dao.selectInfoById(id);
    }

    public Integer updatextCourseInfo(String surface,String info ,Integer id){
        return dao.updateInfo(surface,info,id);
    }
}
